unit ufrmmain;

{$mode objfpc}{$H+}

interface

uses
  Classes,
  SysUtils,
  Forms,
  Controls,
  Graphics,
  Dialogs,
  ComCtrls,
  ExtCtrls,
  StdCtrls;

type

  { Tfrmmain }

  Tfrmmain = class(TForm)
    imgLogo: TImage;
    mmoLog: TMemo;
    pc: TPageControl;
    pnlHead: TPanel;
    sb: TStatusBar;
    tsSet: TTabSheet;
    tsClient: TTabSheet;
    tsLog: TTabSheet;
    procedure FormCreate(Sender: TObject);
  private

  public

  end;

var
  frmmain: Tfrmmain;

procedure doLog(const aMsg: string); overload;
procedure doLog(const aMsg: string; const aParams: array of const); overload;

implementation

{$R *.lfm}

uses
  udmsrv,
  uConst;

{ Tfrmmain }
procedure doLog(const aMsg: string);
begin
  if frmmain <> nil then frmmain.mmoLog.Lines.Add(
      format('%s %s', [formatdatetime('hh:nn:ss.zzz', now), amsg]));
end;

procedure doLog(const aMsg: string; const aParams: array of const);
begin
  if frmmain <> nil then frmmain.mmoLog.Lines.Add(
      format('%s %s', [formatdatetime('hh:nn:ss.zzz', now), format(amsg, aParams)]));
end;

procedure Tfrmmain.FormCreate(Sender: TObject);
begin
  pc.activepageindex := 0;
end;

end.
